# Contributor: Leon Marz <main@lmarz.org>
# Maintainer: Leon Marz <main@lmarz.org>
pkgname=level-zero
pkgver=1.15.1
pkgrel=0
pkgdesc="oneAPI Level Zero Loader"
url="https://spec.oneapi.com/versions/latest/elements/l0/source/index.html"
arch="all"
license="MIT"
makedepends="cmake samurai"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/oneapi-src/level-zero/archive/v$pkgver.tar.gz"
options="!check" # no testsuite

build() {
	CXXFLAGS="$CXXFLAGS -flto=auto" \
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None

	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

dev() {
	default_dev
	amove usr/lib/libze_tracing_layer.so*
	amove usr/lib/libze_validation_layer.so*
}

sha512sums="
594fc39f971fd06be9eb63f894ac9c720ee5ee110963c25f7861c348c4484793a529e39aec12f8aeb02b91666c41eacb3cebc2ebaac4c9e67d2c6ee66f682963  level-zero-1.15.1.tar.gz
"
